export function setDirectives(app) {
  // 加载需要的指令，引入之后放进来
  app.directive('htmldir', {
    mounted(el,binding) {
      if (binding.value == 'ar') {
        el.style.direction = "rtl";
        el.style.textAlign = "right"
      }else{
        el.style.direction = "ltr";
        el.style.textAlign = "left"
      }
    },
    updated(el, binding, vnode, prevVnode) {
      // 组件更新完毕后调用
      if (binding.value == 'ar') {
        el.style.direction = "rtl";
        el.style.textAlign = "right"
      }else{
        el.style.direction = "ltr";
        el.style.textAlign = "left"
      }
    },
  })
}